package com.example.blog.dao;

import com.example.blog.dto.UserDTO;
import com.example.blog.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@Repository
@Mapper
public interface UserDao {
    User findByUserName(String username);
    User findById(Integer id);
    Integer addUser(String username, String password, String nickname, LocalDateTime createtime,LocalDateTime updatetime,Integer role,String avatar);
    Integer updateUser(Integer id,String nickname,String signature,String email,LocalDateTime updatetime);
    Integer updatePwd(Integer id,String newpwd);
    Integer updateAvatarurl(Integer id,String url,LocalDateTime updatetime);

    UserDTO findUserById(Integer userid);

    //admin
    List<User> findAllUser(Integer role);

    Integer deleteById(Integer id);


}
